/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *																 *
 *	r2GLApp - r2 Graphs Library Application						 *
 *																 *
 *	File:		r2GLApp.cpp										 *
 *	Authors:	Rafael Kikuchi ( shinjikik@gmail.com )			 *
 *				Rafael Romeiro ( rafaelromeiro@gmail.com )		 *
 *	Date:		08/09/2008										 *
 *	License:	CC-GNU LGPL										 *
 *				http://creativecommons.org/licenses/LGPL/2.1/	 *
 *	Version:	0.1.0											 *
 *																 *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#include "r2GLApp.h"

void r2GLApp::init (bool Directed, int StructType, string FileName)
{
	myGraph = new Graph(FileName.c_str(), Directed, StructType);
}

void r2GLApp::go (int StartNode)
{
	myGraph->WriteInfo("Info.txt");
	myGraph->WriteGraph("Out.txt");
	myGraph->WriteBFSTree("BFS_Tree.txt", StartNode);
	myGraph->WriteDFSTree("DFS_Tree.txt", StartNode);
	myGraph->WriteConnComponents("Components.txt");
	myGraph->WriteCycle("Cycle.txt");

	myGraph->Reverse();
	myGraph->WriteGraph("Reverse.txt");
}

void r2GLApp::release (void)
{
	delete myGraph;
}